<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get the locale associated with the object</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="intlcalendar.getleastmaximum.html">IntlCalendar::getLeastMaximum</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.getmaximum.html">IntlCalendar::getMaximum</a></div>
 <div class="up"><a href="class.intlcalendar.html">IntlCalendar</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="intlcalendar.getlocale" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">IntlCalendar::getLocale</h1>
  <p class="verinfo">(PHP 5.5.0, PECL &gt;= 3.0.0a1)</p><p class="refpurpose"><span class="refname">IntlCalendar::getLocale</span> &mdash; <span class="dc-title">Get the locale associated with the object</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-intlcalendar.getlocale-description">
  <h3 class="title">说明</h3>
  <p class="para">
   面向对象风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><strong>IntlCalendar::getLocale</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$localeType</code></span>
   )</div>

  <p class="para rdfs-comment">
   过程化风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>intlcal_get_locale</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.intlcalendar.html" class="type IntlCalendar">IntlCalendar</a></span> <code class="parameter">$cal</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$localeType</code></span>
   )</div>

  <p class="para rdfs-comment">
   Returns the locale used by this calendar object.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-intlcalendar.getlocale-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<em><code class="parameter">cal</code></em></dt>

    <dd>

     <p class="para">
      The IntlCalendar resource.
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">localeType</code></em></dt>

    <dd>

     <p class="para">
      Whether to fetch the actual locale (the locale from which the calendar
      data originates, with <strong><code>Locale::ACTUAL_LOCALE</code></strong>) or the
      valid locale, i.e., the most specific locale supported by ICU relatively
      to the requested locale – see <strong><code>Locale::VALID_LOCALE</code></strong>.
      From the most general to the most specific, the locales are ordered in
      this fashion – actual locale, valid locale, requested locale.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-intlcalendar.getlocale-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   A locale string 或者在失败时返回 <strong><code>FALSE</code></strong>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-intlcalendar.getlocale-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2542">
   <p><strong>Example #1 <span class="function"><strong>IntlCalendar::getLocale()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$cal&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">createInstance</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlTimeZone</span><span style="color: #007700">::</span><span style="color: #0000BB">getGMT</span><span style="color: #007700">(),&nbsp;</span><span style="color: #DD0000">'en_US_CALIFORNIA'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getLocale</span><span style="color: #007700">(</span><span style="color: #0000BB">Locale</span><span style="color: #007700">::</span><span style="color: #0000BB">ACTUAL_LOCALE</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getLocale</span><span style="color: #007700">(</span><span style="color: #0000BB">Locale</span><span style="color: #007700">::</span><span style="color: #0000BB">VALID_LOCALE</span><span style="color: #007700">)<br />);</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
string(2) &quot;en&quot;
string(5) &quot;en_US&quot;
</pre></div>
    </div>
   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="intlcalendar.getleastmaximum.html">IntlCalendar::getLeastMaximum</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.getmaximum.html">IntlCalendar::getMaximum</a></div>
 <div class="up"><a href="class.intlcalendar.html">IntlCalendar</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
